@import 'src/styles/constants';

.navbar {
  display: none;
  position: fixed;
  height: calc(100% - #{$headerHeight});
  width: 100%;
  background-color: $white;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  padding-top: 0;
  border-radius: 2px;
  border-right: 2px solid $dark80;
  z-index: 100;

  &.visible {
    display: initial;
  }

  @include desktop {
    opacity: 1;
    display: initial;
    width: $navbarWidth;
    background-color: initial;
    margin-top: 20px;
  }

  .search {
    position: sticky;
    background-color: $white;
    border-bottom: 2px solid $secondary;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
    margin-bottom: 10px;
    width: 100%;
    z-index: 10;
    overflow: hidden;
    transition: width 0.3s;

    &:focus-within {
      width: 100%;
    }

    img {
      display: inline;
      height: 16px;
    }

    .clear-button {
      border: 0;
      padding: 5px;
      background: transparent;
      background: $dark80;
      border-radius: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s;

      &.hidden {
        opacity: 0;
        transform: translateX(40px);
      }

      > img {
        height: 14px;
      }
    }

    input {
      background: transparent;
      color: $dark10;
      width: 100%;
      flex: 1;
      display: inline-block;
      margin-left: 10px;
      height: 100%;
      outline: 0;
      border: 0;
      font-size: $text20;

      &::placeholder {
        color: $dark30;
      }
    }
  }

  ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
  }

  li {
    position: relative;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 2px;

    a {
      display: block;
      padding: 12px 8px;
    }

    &:hover > a > .entry {
      color: $yellow20;
    }

    .entry {
      color: $dark10;
      font-size: 0.9em;
      font-weight: 500;
      width: 100%;
      display: inline-block;
      text-decoration: none;

      &.selected {
        color: $yellow20;
        font-weight: 600;
      }
    }

    .nested {
      border-left: 1px solid $dark60;
      margin-top: 10px;
      padding-left: 10px;
    }

    &.separator {
      border-bottom: 2px solid $dark80;
      width: 100%;
      margin: 8px 0;
      padding: 0;
    }
  }
}
